package 笔试.蔚来;

import java.util.Arrays;

/**
 * @author:谢君臣
 * @Date:2021/8/28-18:53
 * @version:1.0
 * @function:
 */
public class 分面包 {
    public static void main(String[] args) {
        System.out.println(find(new int[]{1, 2, 3}, new int[]{1,1,4}));
    }

    private static int find(int[] arr1, int[] arr2) {
        Arrays.sort(arr1);
        Arrays.sort(arr2);
        int i = 0, j = 0;
        while (j<arr1.length&&i < arr2.length) {
            if (arr2[i]>=arr1[j]){i++;j++;}
            else i++;
        }
        return j;
    }
}
